Page({
  data: {
    message_cont:"",
    payment:null
  },
  onLoad: function (options) {
    console.log(options.goods_id, options.attr, options.attr1)
    this.submitOrder(options.goods_id, options.attr, options.attr1)
  },
  
  submitOrder(a, b, c) {
    var _this = this
    console.log(a, b, c)
    getApp().request({
      url: getApp().api.crowdfund.submit_preview,
      method: "GET",
      data: {
        goods_info: {
          "goods_id": a,
          "num": 1,
          "attr": [{
            "attr_group_id": c,
            "attr_id": b,
          }]
        }
      },
      success(res) {
        var submit = {
          address_id: res.data.address.id,
          offline: 0,
          is_peisong: 0,
          peisong_price: 0,
          goods_info: {
            "goods_id": a,
            "num": 1,
            "attr": [{
              "attr_group_id": c,
              "attr_id": b,
            }]
          },
          content:this.data.message_cont,
          payment:this.data.payment
        };
        _this.setData({
          address: res.data.address,
          goods_info: res.data.list[0],
          peisong_price: res.data.peisong_price,
          integral: res.data.integral.forehead,
          pay_type_list: res.data.pay_type_list,
          submit:submit
        })
        console.log(res.data)
      },
    })
  },
  messages(e){
    this.setData({
      message_cont:e.detail
    })
  },
  wayselect(e){
    this.setData({
      payment:e.detail
    })
  }
})